package com.lianxueda.drawing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lianxueda.drawing.domain.dto.NotificationQueryDTO;
import com.lianxueda.drawing.domain.pojo.Notifications;
import com.lianxueda.drawing.domain.vo.NotificationVO;
import com.lianxueda.drawing.domain.vo.PageVO;
import com.lianxueda.drawing.mapper.NotificationMapper;
import com.lianxueda.drawing.service.NotificationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class NotificationServiceImpl extends ServiceImpl<NotificationMapper, Notifications> implements NotificationService {
    private final NotificationMapper notificationMapper;

    @Override
    public List<Notifications> findByPage(NotificationQueryDTO notificationQueryDTO) {
        if(notificationQueryDTO.getPageSize()==1){
            notificationQueryDTO.setPageSize(0);
        }
        return notificationMapper.findByPage(notificationQueryDTO);
    }
}
